#include "epollServer.hpp"
using namespace epoll_ns;
static void Usage(std::string proc)
{
    std::cerr << "Usage:\n\t" << proc << "port" << "\n\n";
}
std::string Echo(const std::string& message)
{ 
    return "I am epollServer, " + message;
}
//服务器解析读到的函数的接口
//./epollServer port
int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);
    std::unique_ptr<EpollServer> epollServer(new EpollServer(Echo, port));
    epollServer->InitServer();
    epollServer->Start();
    return 0;
}